[No QA] Refactor createOrUpdateStagingDeploy for clarity and maintainability#83119
Draft
roryabraham wants to merge 5 commits intomainfrom
Draft
[No QA] Refactor createOrUpdateStagingDeploy for clarity and maintainability#83119roryabraham wants to merge 5 commits intomainfrom
roryabraham wants to merge 5 commits intomainfrom
Conversation
Extracts StagingDeploy-specific logic from GithubUtils into a dedicated StagingDeployUtils module, restructures the action as a standalone ts-node CLI script with a thin GitHub Actions wrapper, and applies several code quality improvements: - Break run() into focused helpers (buildNewChecklistParams, buildUpdateChecklistParams) - Consolidate checkbox state preservation into preserveCheckboxState() - Generalize checklist parsers into a single parseChecklistSection() helper - Accept PR numbers directly instead of URL roundtripping - Use dedent template literals for issue body construction - Remove void from generateStagingDeployCashBodyAndAssignees return type - Convert .then() chains to async/await throughout Co-authored-by: Cursor <cursoragent@cursor.com>
This comment was marked as resolved.
This comment was marked as resolved.
- Fix "accessble" → "accessible" typo in scripts/createOrUpdateStagingDeploy.ts - Rebuild all GitHub Actions bundles with npm run gh-actions-build Co-authored-by: Cursor <cursoragent@cursor.com>
This comment was marked as resolved.
This comment was marked as resolved.
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
The thin action wrapper only read GITHUB_TOKEN from action input and delegated to the core script. Running the script directly with `npx ts-node` eliminates the ncc build step for this action and reduces file count. Co-authored-by: Cursor <cursoragent@cursor.com>
…m type Both StagingDeployCashPR and StagingDeployCashBlocker had the same shape with differently-named boolean keys. Collapsing them into ChecklistItem with isChecked removes the generic K parameter from parseChecklistSection and preserveCheckboxState, making both functions simpler to read and call. Co-authored-by: Cursor <cursoragent@cursor.com>
…deploy Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # .github/actions/javascript/createOrUpdateStagingDeploy/index.js
Contributor
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
This PR refactors the
createOrUpdateStagingDeployaction to improve clarity, maintainability, and testability. Key changes:Extract
StagingDeployUtils.ts— All StagingDeploy-specific types, parsers, and functions (previously embedded inGithubUtils.ts) are moved into a dedicated module at.github/libs/StagingDeployUtils.ts.Standalone CLI script — The core logic is restructured as
scripts/createOrUpdateStagingDeploy.ts, a standalonets-nodescript that can be run locally. The GitHub Actions entrypoint is reduced to a thin wrapper that imports and callsrun().Code quality improvements:
run()into focused helpers:buildNewChecklistParams()andbuildUpdateChecklistParams()preserveCheckboxState()parseChecklistSection()helperdedenttemplate literals for issue body construction instead of string concatenationvoidfromgenerateStagingDeployCashBodyAndAssigneesreturn type to allow error propagation.then()chains toasync/awaitthroughoutTest updates — StagingDeploy tests are migrated from
GithubUtilsTest.tsto a newStagingDeployUtilsTest.ts. All test imports updated to reflect the new module structure.Fixed Issues
$ #60060
Tests
TODO: manually test the script in App-Test-Fork?
Offline tests
N/A — This is a CI/CD script, not a user-facing feature.
QA Steps
[No QA] — This change only affects CI/CD tooling (GitHub Actions). No user-facing behavior is modified.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
N/A — CI/CD tooling change only
Android: mWeb Chrome
N/A — CI/CD tooling change only
iOS: Native
N/A — CI/CD tooling change only
iOS: mWeb Safari
N/A — CI/CD tooling change only
MacOS: Chrome / Safari
N/A — CI/CD tooling change only